package com.example.demo.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user")
@Tag(name = "用户管理", description = "用户相关接口") // 类级别描述
public class TestController {

    @GetMapping("/{id}")
    @Operation(summary = "查询用户", description = "根据ID获取用户详情") // 方法级别描述
    public String getUser(@PathVariable Long id) {
        return "User " + id;
    }

    @PostMapping
    @Operation(summary = "创建用户")
    public String createUser() {
        return "User created";
    }
}